<template>
	<view class="content">
		<view style="height: 80upx;line-height: 80upx;" class="plr20 C666 fs20">
			您的安全服务
		</view>
		<view class="commonBox1">
			<view class="lh50">
				<text class="fs20 C666">当前安全等级：</text>
				<text class="fs36 Cf00 pl20" v-if="UserInfo.security_level==1">低</text>
				<text class="fs36 CfF0A pl20" v-if="UserInfo.security_level==2">中</text>
				<text class="fs36 C09B pl20" v-if="UserInfo.security_level==3">高</text>
			</view>
			<view class="fs18 Cf7881c" v-if="show">建议您开启全部安全设置，以保障账户及资金安全</view>
		</view>
		
		<view class="commonBox1 flexsb mt20">
			<view style="width: 142upx;" class="tac">
				<image style="width: 90upx;height: 90upx;" src="@/static/images/new_zhaq1.jpg" mode=""></image>
				<view class="fs21 C666">登录密码</view>
				<view class="fs18 C2dc34d" v-if="UserInfo.is_set_pass==1">已设置</view>
				<view class="fs18 Cf74d0f" v-if="UserInfo.is_set_pass==0">未设置</view>
			</view>
			<view style="width: 500upx;" class="">
				<view style="min-height: 170upx;" class="fs18 C666 pl20 lh40" >
					安全性高的密码可以使账号更安全。建议您定期更换密码，且设置一个包含数字和字母，并且长度超过6位以上的密码，为保证您的账户安全，只有在您绑定邮箱或手机后才可以修改密码。
				</view>
				<view class="redBtn fr" v-if="UserInfo.is_set_pass==0" @click="ToPass()">设置密码</view>
				<view class="redBtn fr" v-if="UserInfo.is_set_pass==1" @click="ToPass()">修改密码</view>
			</view>
		</view>
		
		<view class="commonBox1 flexsb mt20">
			<view style="width: 142upx;" class="tac">
				<image style="width: 90upx;height: 90upx;" src="@/static/images/new_zhaq2.jpg" mode=""></image>
				<view class="fs21 C666">邮箱绑定</view>
				<view class="fs18 C2dc34d" v-if="UserInfo.member_email_bind==1">已绑定</view>
				<view class="fs18 Cf74d0f" v-if="UserInfo.member_email_bind==0">未绑定</view>
			</view>
			<view style="width: 500upx;" class="">
				<view style="min-height: 170upx;" class="fs18 C666 pl20 lh40">
					进行邮箱验证后，可用于接收敏感操作的身份验证信息，以及订阅更多优惠商品的促销邮件。
				</view>
				<view @click="toEm()" class="redBtn fr">
					绑定邮箱
				</view>
			</view>
		</view>
		
		<view class="commonBox1 flexsb mt20">
			<view style="width: 142upx;" class="tac">
				<image style="width: 90upx;height: 90upx;" src="@/static/images/new_zhaq3.jpg" mode=""></image>
				<view class="fs21 C666">手机绑定</view>
				<view class="fs18 C2dc34d" v-if="UserInfo.member_mobile_bind==1">已绑定</view>
				<view class="fs18 Cf74d0f" v-if="UserInfo.member_mobile_bind==0">未绑定</view>
			</view>
			<view style="width: 500upx;" class="">
				<view style="min-height: 170upx;" class="fs18 C666 pl20 lh40">
					进行手机验证时，可用于接收敏感操作的身份验证信息，以及进行积分消费的验证确认，非常有助于保护您的账号和账号财产安全。
				</view>
				<view @click="toTel" class="redBtn fr">
					绑定手机
				</view>
			</view>
		</view>
		
		<view class="commonBox1 flexsb mt20">
			<view style="width: 142upx;" class="tac">
				<image style="width: 90upx;height: 90upx;" src="@/static/images/new_zhaq4.jpg" mode=""></image>
				<view class="fs21 C666">支付密码</view>
				<view class="fs18 C2dc34d" v-if="UserInfo.is_set_paypwd==1">已设置</view>
				<view class="fs18 Cf74d0f" v-if="UserInfo.is_set_paypwd==0">未设置</view>
			</view>
			<view style="width: 500upx;" class="">
				<view style="min-height: 170upx;" class="fs18 C666 pl20 lh40">
					设置支付密码后，在使用账户中余额时，需输入支付密码
				</view>
				<view class="redBtn fr" v-if="UserInfo.is_set_paypwd==1" @click="ToPay()">修改密码</view>
				<view class="redBtn fr" v-if="UserInfo.is_set_paypwd==0" @click="ToPay()">设置密码</view>
				<!-- <navigator url="/pages/newpage/SetPay" v-if="UserInfo.is_set_paypwd==0">设置密码</navigator> -->
			</view>
		</view>
		
		<!-- <view class="bottom">
			<view :class="[(active2flag == index)?'active2':'']" @click="tab2(index,item.toUrl)" v-for="(item,index) in bottomBtn" :key="index">
				
				<image :src="active2flag == index ? item.img2 :item.img1" mode=""></image>
				<view :class="[(active2flag == index) ? 'active2':'']">
					{{item.name}}
				</view>
			</view>
		</view> -->
	</view>
	
	
</template>

<script>
	export default {
		data(){
			return{
				show:true,
				active2flag:0,
				UserInfo:"",
				bottomBtn:[
					{"name":"首页","img1":"../../static/images/home_bottom11.png","img2":"../../static/images/home_bottom12.png","toUrl":"../home/index"},
					{"name":"分类","img1":"../../static/images/home_bottom21.png","img2":"../../static/images/home_bottom22.png","toUrl":"../sort/sortPage"},
					{"name":"分销","img1":"../../static/images/home_bottom31.png","img2":"../../static/images/home_bottom32.png","toUrl":"../distribution/list"},
					{"name":"购物车","img1":"../../static/images/home_bottom41.png","img2":"../../static/images/home_bottom42.png","toUrl":"../car/shopCar"},
					{"name":"会员中心","img1":"../../static/images/home_bottom51.png","img2":"../../static/images/home_bottom52.png","toUrl":"/pages/home/Personal_Center"}
				]
			}
		},
		onLoad() {
			this.GetInfo();
		},
		onShow() {
			
		},
		methods:{
			ToPay(){
				uni.redirectTo({
					url:"SetPay"
				})
			},
			ToPass(){
				uni.redirectTo({
					url:"SetPwd"
				})
			},
			GetInfo(){//获取用户信息
				let that = this;
				this.$util.request({
						url: '/mobile/index.php?act=member_security&op=member',
						method: 'POST',
						data: {},
					}).then(function(res) {
						that.UserInfo=res.datas;
						console.log(that.UserInfo)
						that.fs18Show(that,that.UserInfo)
					})
			},
			toEm(){
				uni.redirectTo({
					url:"bangdingEm"
				})
			},
			toTel(){
				uni.redirectTo({
					url:"bangdingTel"
				})
			},
			tab2(index,url){
				this.active2flag=index
				console.log(this.active2flag);
				uni.switchTab({
					url:url
				})
			},
			fs18Show(point,user){
				if(user.is_set_pass==1&&user.member_email_bind==1&&user.member_mobile_bind==1&&user.is_set_paypwd==1){
					point.show = false;
					console.log(point.show)
				}
			}
		}
	}
</script>

<style>
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	view{
		box-sizing: content-box;		
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	.lh20{
		line-height: 20upx;
		height: 20upx;
	}
	.lh25{
		line-height: 25upx;
	}
	.lh30{
		line-height: 30upx;
	}
	.lh35{
		line-height: 35upx;
	}
	.lh40{
		line-height: 40upx;
	}
	.lh45{
		line-height: 45upx;
	}
	.lh50{
		line-height: 50upx;
	}
	.lh80{
		line-height: 80upx;
	}
	.C000{
		color: #000000;
	}
	.Ce13d97{
		color: #ff4300;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.Cc06{
		color: #ff4300;
	}
	.mt55mb30{
		margin-top: 55upx;
		margin-bottom: 30upx;
	}
	.Cfff{
		color: #FFFFFF;
	}
	
	.flex{		
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-content: space-between;
	}
	.paddingL20{
		padding-left: 20upx;
	}
	.C999{
		color:#999 ;
	}
	.Cff0101{
		color:#ff0101 ;
	}
	.Cc00251{
		color: #c00251;
	}
	.strick{
		text-decoration: line-through;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.line1{
		width: 430upx;
	}
	.hide{
		display: none;
	}
	.marginB20{
		margin-bottom: 20upx;
	}
	
	.twoline{
	   overflow : hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.pl20{
		padding-left: 20upx;
	}
	.positionT{
		position: relative;
		top: 50upx;
	}
	.paddingB15{
		padding-bottom: 15upx;
	}
	.borderB{
		border-bottom: 1px solid #f4f4f6;
	}
	.borderT{
		border-top: 1px solid #f4f4f6;
	}
	.gl{
		position: absolute;
		right: 30upx;
	}
	.pr30{
		padding-right: 30upx;
	}
	.C333{
		color: #333333;
	}
	.C666{
		color: #666666;
	}
	.Cf00{
		color: #ff0000;
	}
	.CfF0A{
		color: #F0AD4E;
	}
	.C09B{
		color: #09BB07;
	}
	.bold{
		font-weight: bold;
	}
	.C1d1d1d{
		color:#1d1d1d ;
	}
	.fl{
		float: left;
	}
	.fr{
		float: right;
	}
	.tac{
		text-align: center;
	}
	.Ce5258e{
		color: #e5258e;
	}
	.Cccc{
		color: #CCCCCC;
	}
	.Cf7881c{
		color: #f7881c;
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}		
	.fs30{
		/* font-size: 30upx */
		font-size: 45upx
	}
	.fs26{
		font-size:39upx
		/* font-size: 26upx */
	}
	.fs12{
		font-size: 18upx
		/* font-size: 12upx */
	}
	.fs16{
		font-size: 24upx
		/* font-size: 16upx */
	}
	.fs14{
		font-size: 21upx
		/* font-size: 14upx */
	}
	.fs15{
		font-size: 22.5upx
		/* font-size: 15upx */
	}
	.fs27{
		font-size: 40.5upx
		/* font-size: 27upx */
	}
	.fs18{
		font-size: 27upx
		/* font-size: 18upx */
	}
	.fs28{
		font-size: 42upx
		/* font-size: 28upx */
	}
	.fs10{
		font-size: 15upx
		/* font-size: 10upx */
	}
	.fs30{
		font-size: 45upx
		/* font-size: 28upx */
	}
	.fs36{
		font-size: 54upx
		/* font-size: 28upx */
	}
	
	.fs24{
		font-size: 36upx
		/* font-size: 24upx */
	}
	.fs20{
		font-size:30upx
		/* font-size: 20upx */
	}
	.fs22{
		font-size:33upx
		/* font-size: 22upx */
	}
	.fs21{
		font-size: 31.5upx
		/* font-size: 21upx */
	}	
	.flexsb{
		display: flex;
		justify-content: space-between;
	}
	.plr20{
		padding: 0 20upx;
	}
	.plr10{
		padding: 0 10upx;
	}
	.f6f4f5{
		background-color: #fff;
	}	
	.Cf74d0f{
		color: #f74d0f;
	}
	.C2dc34d{
		color: #2dc34d;
	}
	.mt20{
		margin-top: 20upx;
	}
	.ti2{
		text-indent: 2em;
	}
	
	
	.content{
		padding-bottom: 200upx;
		min-height: 100vh;
		background-color: #f6f4f5;
	}
	.commonBox1{
		padding: 36upx 48upx;
		background-color: #fff;		
	}
	.redBtn{
		margin-top: 20upx;
		width: 200upx;
		height: 64upx;
		line-height: 64upx;
		color: #FFFFFF;
		background-color: #ff4300;
		text-align: center;
	}
	.bottom{
		box-sizing: border-box;
		padding: 0 10upx;
		background-color: #FFFFFF;
		position: fixed;
		z-index: 99999999999;
		left: 0;
		bottom: 0;
		height: 98upx;
		width: 100%;
		box-shadow: 0upx -1upx 10upx rgba(0,0,0,0.8);
		display: flex;
		flex-direction: row;
		justify-content: space-around;
	}
	.bottom view{
		font-size: 27upx;
		color: #666;
		text-align: center;
	}
	.bottom view.active2{
		color: #ff4300;
	}
	.bottom image{
		position: relative;
		top: 15upx;
		width: 33upx;
		height: 33upx;
	}
	
</style>

